<template>
	<view class="pageBg">
		<view class="header flex_c_c_c">
			<view class="title margin_b64">
				<text class="f_48 fw_600 tc_1">{{data.detail.title}}</text>
			</view>
			<view class="w100 f_22 fw_500 tc_9 flex_r_sb_c">
				<view class="flex_c_c_fs">
					<view class="margin_b8 flex_r_c_c">
						<text class="margin_r16">{{data.detail.category}}</text>
						<text>{{data.detail.author_name}}</text>
					</view>
					<view class="">
						<text>{{data.detail.date}}</text>
					</view>
				</view>
				<view class="followBtn f_24 fw_500 tc_w bg_g flex_r_c_c">+ 关注</view>
			</view>
		</view>
		<view class="cnt margin_b64">
			<jyf-parser :html="data.content"></jyf-parser>
		</view>
		<view class="footer flex_r_sb_c">
			<view class="footerItem f_28 fw_500 tc_6 flex_r_c_c">投币</view>
			<view class="footerItem f_28 fw_500 tc_6 flex_r_c_c">点赞</view>
			<view class="footerItem f_28 fw_500 tc_6 flex_r_c_c">收藏</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: null,
				data: {},
				refresh: true,
			};
		},
		onLoad(e) {
			this.id = e.id
			this.getData()
		},
		methods: {
			getData() {
				const _this = this
				const key = '8b99a148da67fea6e7f8c3f7966fad0f'
				const url = 'https://v.juhe.cn/toutiao/content'
				_this.$api.get({
					url: url,
					loadingTip: _this.refresh ? '获取数据中...' : '',
					data: {
						key: key,
						uniquekey: _this.id
					},
					success: res => {
						_this.data = res.result
					},
					fail: err => {}
				})
			},
		},
	}
</script>

<style lang="scss" scoped>
.pageBg {
	padding: 64rpx 28rpx;
	box-sizing: border-box;
	.header {
		margin-bottom: 64rpx;
		.followBtn {
			height: 50rpx;
			border-radius: 25rpx;
			padding: 0 24rpx;
			box-sizing: border-box;
		}
	}
	.footer {
		.footerItem {
			width: 30%;
			height: 60rpx;
			border-radius: 30rpx;
			border: 2rpx solid #999;
		}
	}
}
</style>
